//package com.smile.handler;
//
//import com.alibaba.fastjson2.JSONObject;
//import com.smile.mqtt.handler.AbstractConfigHandler;
//import org.eclipse.paho.client.mqttv3.MqttClient;
//import org.eclipse.paho.client.mqttv3.MqttConnectOptions;
//import org.eclipse.paho.client.mqttv3.MqttException;
//import org.eclipse.paho.client.mqttv3.MqttMessage;
//import org.eclipse.paho.client.mqttv3.persist.MemoryPersistence;
//import org.springframework.stereotype.Component;
//
//@Component
//public class DefaultConfigHandler extends AbstractConfigHandler {
//    @Override
//    public Boolean process(String data, String tid, String bid) throws MqttException {
//
////        System.out.println(data);
//
//
////        DeviceConfigResponse<DeviceAppConfig> deviceConfigResponse = new DeviceConfigResponse<>();
////
////
////        DeviceAppConfig deviceAppConfig = new DeviceAppConfig();
////        deviceAppConfig.setAppId("144844");
////        deviceAppConfig.setAppKey("db858df7ef2c2de9b566414a0d54de9");
////        deviceAppConfig.setAppLicense("BVTjqXIO2t8OlaIpK2XEKohfC0eBIQx2SIM6o0qUS6wYe9mYG3M163Gq1DeJzrbvlSKZ/sFKlr7eTO6u9OFKBkZfpbJQy/yrFDNaIKwM+hSS1OFjCLibdi2jxjlnDpW+JnHl0SplUOFbErCOTVYYAckEuMXf7wqHQSofSYrmgpY=");
////
////        deviceConfigResponse.setData(deviceAppConfig);
////
////        //{"tid":"b098d85b-b9a3-4a89-b4c6-afb392bd4a27","bid":"4f762225-b612-4395-9cbc-1b9cb4637cbb","timestamp":1750744078601,"method":"config","data":{"config_type":"json","config_scope":"product"},"gateway":"8UUXN2800A00HX"}
////
////        deviceConfigResponse.setBid(bid);
////        deviceConfigResponse.setTid(tid);
////        deviceConfigResponse.setGateway("1581F8HGX252500A0022");
////        deviceConfigResponse.setTimestamp(System.currentTimeMillis());
////        deviceConfigResponse.setMethod("config");
////
////
////        //        deviceAppConfig.setNtpServerHost();
//////        deviceAppConfig.setNtpServerPort();
////
////        MqttMessage message = new MqttMessage();
////        message.setQos(0);
////        message.setRetained(true);
////        message.setPayload(JSONObject.toJSONString(deviceConfigResponse).getBytes());
////        MqttClient mqttClient = new MqttClient("tcp://120.211.119.131:1883", "feisuan-mqtt-producer-client", new MemoryPersistence());
////        MqttConnectOptions connOpts = new MqttConnectOptions();
////        connOpts.setUserName("feisuan");
////        connOpts.setPassword("feisuan123456".toCharArray());
////        mqttClient.connect(connOpts);
////
////        mqttClient.publish("thing/product/8UUXN2800A00HX/requests_reply", message);
//        return Boolean.TRUE;
//    }
//
//
//}
